home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / Itch / work_info / xmasCard.dcr / 00093_partParent.ls < prev    next >
Encoding:
Text File  |  1999-03-07  |  966 b   |  40 lines

  1. property posH, posV, memName, mem, myRect, offsetH, offsetV, offdist, myAng
  2. global viewObj, mouseObj, world
  3.  
  4. on new me, offH, offV, amemName
  5.   offsetH = offH
  6.   offsetV = offV
  7.   offdist = getDistNum(0, 0, offH, offV)
  8.   myAng = findAngle(0, 0, offH, offV)
  9.   memName = "blank"
  10.   mem = member(amemName)
  11.   myRect = offset(mem.rect, offsetH, offsetV)
  12.   return me
  13. end
  14.  
  15. on draw me, sp, viewOffsetH, viewOffsetV
  16.   set the member of sprite sp to mem
  17.   temprect = offset(myRect, -viewOffsetH, -viewOffsetV)
  18.   set the rect of sprite sp to mem.rect
  19.   set the loc of sprite sp to point(temprect.left, temprect.top)
  20.   sp = sp + 1
  21.   return sp
  22. end
  23.  
  24. on move me, h, v, ang
  25.   temp = addang(ang, myAng)
  26.   g = findMotion(temp)
  27.   offsetH = getAt(g, 1) * offdist
  28.   offsetV = getAt(g, 2) * offdist
  29.   posH = h + offsetH
  30.   posV = v + offsetV
  31.   myRect = mem.rect
  32.   myRect = offset(myRect, posH, posV)
  33. end
  34.  
  35. on moveTo me, h, v
  36.   posH = h
  37.   posV = v
  38.   myRect = offset(me.mem.rect, posH, posV)
  39. end
  40.